import React, { Component } from 'react';
import Button from 'react-native-button';

export default class ExampleComponent extends Component {
    constructor(props, context) {
        super(props, context);
        this.state = {
            isDisabled: false
        }
    }
    _handlePress() {
        this.setState({
            isDisabled: true
        });
        console.log('Now, button disabled');
    }
    render() {
        const { isDisabled } = this.state;
        return (
            <Button
                style={{ fontSize: 20, color: 'white' }}
                styleDisabled={{ color: 'white' }}
                disabled={isDisabled}
                containerStyle={{ padding: 10, height: 45, overflow: 'hidden', borderRadius: 4, backgroundColor: 'aqua' }}
                disabledContainerStyle={{ backgroundColor: 'pink' }}
                onPress={() => this._handlePress()}
            >
                Press Me!
            </Button>
        );
    }
};